#coding=utf-8

file = open('myapp.log','r')
# for line in file.readlines():
#     print line
# file.close()

fileappend = open('myapp.log','r+')
print 'position is {}'.format(fileappend.tell())
fileappend.seek(100)
print fileappend.read(100)
fileappend.write('hahahahhahahahah \n')    #在最开始添加数据
fileappend.close()



